<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/public/header.jsp"%>
<%
	String return_id = request.getParameter("return_id") == null ? "" : request.getParameter("return_id");
%>
<html>
	<head>
		<title>打印预览</title>
		<style>
			.td1{
				padding-top:10px;
				padding-bottom:5px;
				font-size: 12px;
				background-color: #c0ebd7;
				width:20%;
			}
			.td2{
				padding:5px;
			}
			.datagrid-cell {
			  font-size: 18px;
			}
		</style>
	<script type="text/javascript">
		$(function(){
			$.ajax({
				 type:'GET',
				 url:'<%=contextPath %>/springMVC/gd/getPurchaseReturnApplyById?return_id=<%=return_id%>',
				 success:function(rtData){
					 $('#gd_code').html(rtData.gd_code);
					 $('#gd_name').html(rtData.gd_name);
					 $('#dept_name').html(rtData.dept_name);
					 $('#person').html(rtData.person);
					 $('#operation_date').html(rtData.operation_date);
					 $('#remark').html(rtData.remark);
				 }
			 });
			$('#table').datagrid({
				url:'<%=contextPath%>/springMVC/gd/listGDPurchaseReturnApplyDetail.jsp?return_id=<%=return_id%>',
				rownumbers:true,
				fitColumns:true,
				columns:[[
					{title:'产品编号',field:'code',width:100,align:'center'},
					{title:'产品名称',field:'name',width:200,align:'center'},
					{title:'规格/型号',field:'format_type',width:200,align:'center'},
					{title:'单位',field:'unit_name',width:50,align:'center'},
					{title:'申请退料数量',field:'num',width:100,align:'center'},
					{title:'备注',field:'remark',width:260,align:'center'}
				]]
			});
		});
		function startPrint(obj){
			$(obj).hide();
			window.print();
		}
	</script>
	</head>
	<body>
		<div style="width: 97%;padding-left:10px">
		<form id="ff">
			<table  style="border-collapse: collapse;" width="100%" border="1px" bordercolor="#0eb83a">
			<tr>
					<td class="td2" align="center" colspan="4">
						<b><span  id="title">采购退料</span></b>
					</td>
				</tr>
				<tr>
					<td align="right" class="td1" nowrap>工单编号：</td>
					<td class="td2" nowrap>
						<span id="gd_code"></span>
					</td>
					<td align="right" class="td1" nowrap>工单名称：</td>
					<td class="td2" nowrap>
						<span id="gd_name"></span>
					</td>
				</tr>
				<tr>
					<td align="right" class="td1" nowrap>申请部门：</td>
					<td class="td2" nowrap>
						<span id="dept_name"></span>
					</td>
					<td align="right" class="td1" nowrap>申请人：</td>
					<td class="td2" nowrap>
						<span id="person"></span>
					</td>
				</tr>
				<tr>
					<td align="right" class="td1" nowrap>申请日期：</td>
					<td class="td2" nowrap colspan='3'>
						<span id="operation_date"></span>
					</td>
				</tr>
				<tr>
					<td align="right" class="td1" nowrap>摘要：</td>
					<td class="td2" nowrap colspan='3'>
						<span id="remark"></span>
					</td>
				</tr>
				<tr>
					<td align="right" class="td1" nowrap></td>
					<td class="td2" nowrap colspan='3'>
						<div align="left">
							<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-print'" onclick="startPrint(this);">确认打印</a>
						</div>
					</td>
				</tr>
				<tr>
					<td colspan="4"  nowrap>
						<div id="table"></div>
					</td>
				</tr>
			</table>
			</form>
		</div>
		
	</body>
</html>